/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package org.cip.esymons.tramite.bc;

import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import org.cip.esymons.tramite.be.CuentaingresoTramite;
import org.cip.esymons.tramite.be.Tramite;

/**
 *
 * @author FreddyHIQ
 */
public class CuentIngresoTraDelegate {

    private CuentaingresoTramiteFacadeLocal local;

    public CuentIngresoTraDelegate() {
        local=lookupCuentaingresoTramiteFacade();
    }

    public void create(CuentaingresoTramite ci){
        local.create(ci);
    }

    public void remove(CuentaingresoTramite ci){
        local.remove(ci);
    }

    public CuentaingresoTramite find(Long id){
        return local.find(id);
    }

    public List<CuentaingresoTramite> listarXTramite(Tramite trm){
        return local.listarXTramite(trm);
    }


    private CuentaingresoTramiteFacadeLocal lookupCuentaingresoTramiteFacade() {
        try {
            Context c = new InitialContext();
            return (CuentaingresoTramiteFacadeLocal) c.lookup("java:comp/env/CuentaingresoTramiteFacade");
        } catch (NamingException ne) {
            Logger.getLogger(getClass().getName()).log(Level.SEVERE, "exception caught", ne);
            throw new RuntimeException(ne);
        }
    }
}